package com.ruoyi.manage.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.manage.mapper.CrStudentProfileMapper;
import com.ruoyi.manage.domain.CrStudentProfile;
import com.ruoyi.manage.service.ICrStudentProfileService;

/**
 * 学生扩展信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-01-20
 */
@Service
public class CrStudentProfileServiceImpl implements ICrStudentProfileService 
{
    @Autowired
    private CrStudentProfileMapper crStudentProfileMapper;

    /**
     * 查询学生扩展信息
     * 
     * @param profileId 学生扩展信息主键
     * @return 学生扩展信息
     */
    @Override
    public CrStudentProfile selectCrStudentProfileByProfileId(Long profileId)
    {
        return crStudentProfileMapper.selectCrStudentProfileByProfileId(profileId);
    }

    /**
     * 根据用户ID查询学生扩展信息
     * 
     * @param userId 用户ID
     * @return 学生扩展信息
     */
    @Override
    public CrStudentProfile selectCrStudentProfileByUserId(Long userId)
    {
        return crStudentProfileMapper.selectCrStudentProfileByUserId(userId);
    }

    /**
     * 查询学生扩展信息列表
     * 
     * @param crStudentProfile 学生扩展信息
     * @return 学生扩展信息
     */
    @Override
    public List<CrStudentProfile> selectCrStudentProfileList(CrStudentProfile crStudentProfile)
    {
        return crStudentProfileMapper.selectCrStudentProfileList(crStudentProfile);
    }

    /**
     * 新增学生扩展信息
     * 
     * @param crStudentProfile 学生扩展信息
     * @return 结果
     */
    @Override
    public int insertCrStudentProfile(CrStudentProfile crStudentProfile)
    {
        crStudentProfile.setCreateTime(DateUtils.getNowDate());
        return crStudentProfileMapper.insertCrStudentProfile(crStudentProfile);
    }

    /**
     * 修改学生扩展信息
     * 
     * @param crStudentProfile 学生扩展信息
     * @return 结果
     */
    @Override
    public int updateCrStudentProfile(CrStudentProfile crStudentProfile)
    {
        crStudentProfile.setUpdateTime(DateUtils.getNowDate());
        return crStudentProfileMapper.updateCrStudentProfile(crStudentProfile);
    }

    /**
     * 批量删除学生扩展信息
     * 
     * @param profileIds 需要删除的学生扩展信息主键数组
     * @return 结果
     */
    @Override
    public int deleteCrStudentProfileByProfileIds(Long[] profileIds)
    {
        return crStudentProfileMapper.deleteCrStudentProfileByProfileIds(profileIds);
    }

    /**
     * 删除学生扩展信息信息
     * 
     * @param profileId 学生扩展信息主键
     * @return 结果
     */
    @Override
    public int deleteCrStudentProfileByProfileId(Long profileId)
    {
        return crStudentProfileMapper.deleteCrStudentProfileByProfileId(profileId);
    }
}